using Blazored.LocalStorage;
using Microsoft.AspNetCore.Components;
using StudentVideo.Client.Common.Constants;

namespace StudentVideo.Client;

public partial class App: ComponentBase {
   [Inject]
   private ILocalStorageService LocalStorage { get; set; } = null!;

   [Inject]
   private NavigationManager Navigation { get; set; } = null!;

   protected override async Task OnAfterRenderAsync(bool firstRender) {
      await base.OnAfterRenderAsync(firstRender);

      var token = await LocalStorage.GetItemAsync<string>(LocalStorageKeys.Token);
      // if (string.IsNullOrEmpty(token)) {
      //    Navigation.NavigateTo(PagePath.Login, new NavigationOptions { ReplaceHistoryEntry = true });
      // }
   }
}
